package com.ketangpai.admin.entity.dto;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.ketangpai.admin.entity.Course;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.web.multipart.MultipartFile;

import java.util.Date;
@Data
public class CourseDTO {
    /**
     * 课程id
     */
    @TableId(type = IdType.AUTO)
    private Integer id;
    /**
     * 课程名称
     */
    private String courseName;
    /**
     * 课程名称
     */
    private String courseCode;
    /**
     * 创建人id
     */
    private Integer userId;
    /**
     * 班级
     */
    private String clazz;
    /**
     * 创建时间
     */
    @TableField(fill = FieldFill.INSERT)
    private Date createTime;
    /**
     * 上课模式（1：线上 2：线下 3:混合）
     */
    private int mode;
    /**
     * 课程详情
     */
    private String courseDetail;
    /**
     * 上课地点
     */
    private String courseLocation;
    /**
     * 学期
     */
    private String semester;
    /**
     * 学年
     */
    private String academicYear;
    /**
     * 背景图片
     */
    private String backgroundImage;
    /**
     * 学时
     */
    private Integer courseHour;

    /**
     * 文件
     */
    @TableField(exist = false)
    @ApiModelProperty(dataType = "MultipartFile" ,name = "文件",value = "file")
    private MultipartFile file;

    private Integer type;

    private String actor;//创建人

    private Integer isTop;

    private Integer isPigeonhole;
    private Integer number;//成员

    public CourseDTO(){}

    public CourseDTO(Course course, Integer type, String actor,Integer isTop ,Integer isPigeonhole,Integer member){
        this.type=type;
        this.academicYear=course.getAcademicYear();
        this.courseCode=course.getCourseCode();
        this.backgroundImage=course.getBackgroundImage();
        this.clazz=course.getClazz();
        this.courseDetail=course.getCourseDetail();
        this.courseHour=course.getCourseHour();
        this.courseLocation=course.getCourseLocation();
        this.courseName=course.getCourseName();
        this.createTime=course.getCreateTime();
        this.file=course.getFile();
        this.id=course.getId();
        this.mode=course.getMode();
        this.semester=course.getSemester();
        this.userId=course.getUserId();
        this.actor=actor;
        this.isTop=isTop;
        this.isPigeonhole=isPigeonhole;
        this.number=member;
    }
}
